home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Skunkware 5
/
Skunkware 5.iso
/
src
/
X11
/
xsw
/
var.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-05-09
|
6KB
|
162 lines
/*
* @(#) var.c 12.1 95/05/09 SCOINC
*/
/***************************************************************************
*
* Copyright (c) 1990-1993 The Santa Cruz Operation, Inc.
*
* All rights reserved. No part of this program or publication may be
* reproduced, transmitted, transcribed, stored in a retrieval system,
* or translated into any language or computer language, in any form or
* by any means, electronic, mechanical, magnetic, optical, chemical,
* biological, or otherwise, without the prior written permission of:
*
* The Santa Cruz Operation , Inc. (408) 425-7222
* 400 Encinal St., Santa Cruz, California 95060 USA
*
**************************************************************************/
/*
* Modification History
*
* S002, 27-May-93, rickra
* Added pixmap support...
*
* S001, 01-Jan-93, rickra
* Added support for seperate windows.
*
* S000, 30-Sep-92, rickra
* Added copyright and modification history
*/
/*+-------------------------------------------------------------------------
var.c - XSW var struct handler
Defined functions:
draw_Var(x,y)
--------------------------------------------------------------------------*/
/*+:EDITS:*/
/*:09-25-1990-05:11-wht@n4hgf-release heh-heh x0.22 preliminary */
/*:09-20-1990-02:17-wht@n4hgf-adapt u386mon code */
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Intrinsic.h>
#include <X11/Shell.h>
#include <Xm/Xm.h>
#include <Xm/MainW.h>
#include <Xm/DrawingA.h>
#include "include/unixincs.h"
#include "include/buttons.h"
#include "include/xsw.h"
extern struct NetworkXswStruct *current_server;
static int line_style = LineSolid;
static int cap_style = CapButt;
static int join_style = JoinMiter;
/*+-------------------------------------------------------------------------
draw_Var(window,display,gc,DrawAreaXYWH,x,y)
--------------------------------------------------------------------------*/
int
draw_Var (SP, x, y)
struct NetworkXswStruct *SP;
int x;
int y;
{
Window window = SP -> SEPERATE_WINDOWS_LIST[BUTTON_tune_var].window;
Display *display = SP -> SEPERATE_WINDOWS_LIST[BUTTON_tune_var].display;
GC gc = SP -> SEPERATE_WINDOWS_LIST[BUTTON_tune_var].gc;
XWindowAttributes DrawAreaXYWH = SP -> SEPERATE_WINDOWS_LIST[BUTTON_tune_var].DrawAreaXYWH;
Pixmap pixmap = SP -> SEPERATE_WINDOWS_LIST[BUTTON_tune_var].pixmap;
char *cptr;
int fwidth = FWIDTH;
int fheight = FHEIGHT;
int len;
int x2 = x;
int yl1 = y + (FASCENT / 2);
int yl2 = y + (FHEIGHT / 2) - 1;
int ys = y + FASCENT;
cptr = "---Var----------";
len = strlen (cptr);
/* the "background" bar */
XSetForeground (display, gc, colorTitleBarBG.pixel);
XSetLineAttributes (display, gc, fheight, line_style, cap_style, join_style);
/*
XDrawLine (display, window, gc, x, yl1, x + (len * fwidth), yl1);
*/
XDrawLine (display, pixmap, gc, x, yl1, x + (len * fwidth), yl1);
/* draw the black line before "Var" */
XSetForeground (display, gc, colorTitleBarFG.pixel);
XSetLineAttributes (display, gc, FASCENT / 2, line_style, cap_style, join_style);
/*
XDrawLine (display, window, gc,
x2, yl1,
x2 + (len = (fwidth * 3)) - FGAP, yl1);
*/
XDrawLine (display, pixmap, gc,
x2, yl1,
x2 + (len = (fwidth * 3)) - FGAP, yl1);
x2 += len;
/* draw "Var" */
cptr = "Var";
/*
XDrawString (display, window, gc, x2, ys, cptr, len = strlen (cptr));
XDrawString (display, window, gc, x2 + 1, ys, cptr, len = strlen (cptr));
*/
XDrawString (display, pixmap, gc, x2, ys, cptr, len = strlen (cptr));
XDrawString (display, pixmap, gc, x2 + 1, ys, cptr, len = strlen (cptr));
x2 += fwidth * len;
/* draw the black line after "Var" */
/*
XDrawLine (display, window, gc,
x2 + FGAP + 1, yl1,
x2 + (len = (fwidth * 10)), yl1);
*/
XDrawLine (display, pixmap, gc,
x2 + FGAP + 1, yl1,
x2 + (len = (fwidth * 10)), yl1);
y += fheight;
disp_static_int (window, display, gc, DrawAreaXYWH, pixmap, x, y, "v_autoup ", "%5d", current_server -> my_v -> v_autoup);
y += fheight;
disp_static_int (window, display, gc, DrawAreaXYWH, pixmap, x, y, "v_buf ", "%5d", current_server -> my_v -> v_buf);
y += fheight;
disp_static_int (window, display, gc, DrawAreaXYWH, pixmap, x, y, "v_clist ", "%5d", current_server -> my_v -> v_clist);
y += fheight;
disp_static_int (window, display, gc, DrawAreaXYWH, pixmap, x, y, "v_file ", "%5d", current_server -> my_v -> v_file);
y += fheight;
disp_static_int (window, display, gc, DrawAreaXYWH, pixmap, x, y, "v_hbuf ", "%5d", current_server -> my_v -> v_hbuf);
y += fheight;
disp_static_int (window, display, gc, DrawAreaXYWH, pixmap, x, y, "v_inode ", "%5d", current_server -> my_v -> v_inode);
y += fheight;
disp_static_int (window, display, gc, DrawAreaXYWH, pixmap, x, y, "v_maxpmem ", "%5d", current_server -> my_v -> v_maxpmem);
y += fheight;
disp_static_int (window, display, gc, DrawAreaXYWH, pixmap, x, y, "v_maxup ", "%5d", current_server -> my_v -> v_maxup);
y += fheight;
disp_static_int (window, display, gc, DrawAreaXYWH, pixmap, x, y, "v_mount ", "%5d", current_server -> my_v -> v_mount);
y += fheight;
disp_static_int (window, display, gc, DrawAreaXYWH, pixmap, x, y, "v_pbuf ", "%5d", current_server -> my_v -> v_pbuf);
y += fheight;
disp_static_int (window, display, gc, DrawAreaXYWH, pixmap, x, y, "v_proc ", "%5d", current_server -> my_v -> v_proc);
y += fheight;
disp_static_int (window, display, gc, DrawAreaXYWH, pixmap, x, y, "v_region ", "%5d", current_server -> my_v -> v_region);
y += fheight;
disp_static_int (window, display, gc, DrawAreaXYWH, pixmap, x, y, "v_vhndfrac ", "%5d", current_server -> my_v -> v_vhndfrac);
return (y);
} /* end of draw_Var */
/* vi: set tabstop=4 shiftwidth=4: */
/* end of var.c */